﻿#region Copyright (C) Sector7 Software Studio. All rights reserved
/*******************************************************************************************
 * Creation
 *      Author:         Wolf Lai
 *      Date:           2012/3/26 23:01:18
 *      Version:        
 * Modification 
 *      Author: 
 *      Date: 
 *      Description: 
 *      Version:
 *******************************************************************************************/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;

namespace Sector7.Restaurant.CoreType.Events
{
    /// <summary>
    /// DataGridView单击行事件委托
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    public delegate void DataGridViewRowClickEventHandler(object sender, DataGridViewRowClickEventArgs e);

    /// <summary>
    /// DataGridView单击行事件参数
    /// </summary>
    public class DataGridViewRowClickEventArgs
    {
        #region Inner members
        /// <summary>
        /// 行包含数据对象
        /// </summary>
        private object _tag;

        /// <summary>
        /// 按下的鼠标按钮
        /// </summary>
        private MouseButtons _button;

        /// <summary>
        /// 发生事件时鼠标位置
        /// </summary>
        private Point _location;
        #endregion

        #region Accessor
        /// <summary>
        /// 获取点击行包含数据对象
        /// </summary>
        public object Tag
        {
            get { return _tag; }
        }

        /// <summary>
        /// 获取按下的鼠标按钮
        /// </summary>
        public MouseButtons Button
        {
            get { return _button; }
        }

        /// <summary>
        /// 获取发生事件时鼠标位置
        /// </summary>
        public Point Location
        {
            get { return _location; }
        }
        #endregion

        #region Structure
        /// <summary>
        /// 创建 DataGridViewRowClickEventArgs 对象
        /// </summary>
        /// <param name="tag">行包含数据对象</param>
        /// <param name="button">按下的鼠标按钮</param>
        /// <param name="location">发生事件时鼠标位置</param>
        public DataGridViewRowClickEventArgs(object tag, MouseButtons button, Point location)
        {
            _tag = tag;
            _button = button;
            _location = location;
        }
        #endregion
    }
}
